﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace TravellerApp1.Views
{
    /// <summary>
    /// UserorAdmin.xaml 的交互逻辑
    /// </summary>
    public partial class UserorAdmin : Window
    {
        public UserorAdmin()
        {
            InitializeComponent();
        }

        private void btn1_Click(object sender, RoutedEventArgs e)
        {
            GotoAdminWindow(this);
        }

        private void btn2_Click(object sender, RoutedEventArgs e)
        {
            GotoUserLogin(this);
        }

        public static void GotoAdminWindow(UserorAdmin current)
        {
            AdminWindow login1 = new();
            login1.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            login1.Show();
            WinHelper.ForceClose(current);
        }

        public static void GotoUserLogin(UserorAdmin current)
        {
            UserLogin login1 = new();
            login1.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            login1.Show();
            WinHelper.ForceClose(current);
        }
    }
}
